﻿@using Controllers
@{
    var func=new MyFunc();
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@Html.Partial("_top")
</head>
<body>
    <div id="wrapper">	
@Html.Partial("_header")

        <div id="masterbody">
            <div class="contentcon1">
				<ul class="listImg">
							<div class="lmTitle"><h2>@ViewBag.model.title</h2></div>
@{    var page = Request.QueryString["page"];
							int p = 1;
							int pagesize=ViewBag.model.info["model"].mpnum;
							if (!string.IsNullOrEmpty(page))
							{
								p = Convert.ToInt32(page);
							}
							var pagelist=func.GetPageList(p,pagesize,ViewBag.model.ID);}
						@for (int i = 0; i < pagelist.Items.Count; i++)
						{
						var item=pagelist.Items[i];						
					var url=string.IsNullOrEmpty(item.url)?"/article/"+item.ID:item.url;
					var target=string.IsNullOrEmpty(item.url)?"_self":"_blank";
						<li>
                            <a href="@url" title="@item.title" target="@target">
                                <img src="@item.pic"/><div>
                                <strong>@item.title</strong>
                                <span>查看更多</span></div>
                            </a>
                        </li>
						}
					</ul>
		<div class="page">
			<ul class="pagination">
			@if(pagelist.CurrentPage>1){
			<li><a href="/list/@ViewBag.model.ID?page=@(pagelist.CurrentPage-1)">上一页</a></li>
			}
			else{
			<li><a>首页</a></li>
			}
			
			@if(pagelist.CurrentPage<pagelist.TotalPages){
				<li><a href="/list/@ViewBag.model.ID?page=@(pagelist.CurrentPage+1)">下一页</a></li>
			}
			else{
			<li><a>尾页</a></li>
			}
			</ul>
			</div>
				
            </div>
        </div>
        <div id="mcopyright">@Html.Raw(ViewBag.model.copyright)</div>
        <div class="gotop"><a href="#top">返回顶部</a></div>
        <div class="space"></div>
    </div>

</body>
</html>
